﻿using UnityEngine;
using Vector2 = TopHero.Vector2;

public class RoadUnityObject : CellUnityObject
{
    private void OnDrawGizmos()
    {
        Gizmos.color = Color.white;
        Vector3 pos = new Vector3(transform.position.x, transform.position.y, 1.0f);
        UnityUtility.DrawRectangle(pos, new Vector3(0.95f, 0.95f, 0));

        if (_linkedEntity != null)
        {
            Vector2 position = _linkedEntity.GetPosition();
            int index = GameController.Instance.game.world.PositionToIndex(position);
            GUIStyle style = new GUIStyle();
            style.normal.textColor = Color.magenta;
            style.fontSize = 10;
            UnityEditor.Handles.Label(new Vector3(position.x, position.y, 1), new GUIContent(index.ToString()), style);
        }
    }
}